home *** CD-ROM | disk | FTP | other *** search
- Path: ssc.sas.upenn.edu!modavis
- From: modavis@ssc.sas.upenn.edu (Morris A. Davis)
- Newsgroups: comp.lang.c++
- Subject: Re: Fahrenheight to Celsius?
- Date: 16 Feb 1996 18:46:24 GMT
- Organization: University of Pennsylvania
- Message-ID: <4g2je0$ags@netnews.upenn.edu>
- References: <4fra3q$ddt@newsbf02.news.aol.com> <4fvthq$2bl@newserv.agcs.com> <DMvMCv.KzA@tr.unisys.com>
- NNTP-Posting-Host: ssc.sas.upenn.edu
- X-Newsreader: TIN [version 1.2 PL2-upenn1.3]
-
- Benjamin M. Romer (bmr1@trpo4.tr.unisys.com) wrote:
- : okay.. here goes nothing:
-
- : #include <iostream.h>
-
- : class Celcius;
-
- : class Farenheight
- : {
- : private:
- : double temp;
- : public:
- : Farenheight(double tmp)
- : :temp(tmp)
- : {}
- : Celcius operator Celcius()
- : {
- : return Celcius((temp - 32) / 2.5);
-
- (5/9) != (1/2.5)
-
- OK here's your homework:
- 1) define f=temperature in farenheit
- 2) define c=temperature in celcius
-
- If they enter farenheit, convert to celcius by
- c=(f-32)*5/9
-
- If they enter celcius, convert to farenheit by
- f=(9/5)*c + 32 (duh, see above)
-
- Please, lets end this thread. Now I'm sorry I even contributed
- And, kid, stop posting your homework questions!
-
- Morris Davis
-